feat(image-compare): add SSIM as parallel diff signal#7
Open
bazmatic wants to merge 14 commits into
Open
Conversation
…l gate Reduced from 353 to 208 lines by collapsing redundant prose and the standalone "What NOT to Do" table into a consolidated Key Rules table. Moved post-implementation visual verification from a skippable Phase 5b heading into a numbered step 12 inside Phase 5, labelled as a hard gate to prevent agents from skipping it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Delegate screenshot comparison to a skeptical subagent in both Phase 5 and Phase 7, with an explicit adversarial prompt covering 13 diff categories including gradients, charts, and visual effects - Warn not to assume asset file format — check content-type before downloading, as Figma images are frequently SVGs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both Phase 5 and Phase 7 subagent prompts now include the section name, node ID, expected size, and catalogue description so subagents can anchor their diff against what was documented, and flag missing elements with confidence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a prominent scale warning to both Phase 5 and Phase 7 subagent prompts, and elevates sizing to a high-risk category with an explicit proportional comparison check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Before handing off to the skeptical subagent, the implementing agent now scores section complexity 1–3 and runs the subagent that many times sequentially. Each pass receives the cumulative findings from prior passes and is instructed to re-examine independently, not just confirm. Applied to both Phase 5 (visual gate) and Phase 7 (audit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Catalogue now stores CSS layout, typography tables, colour tokens, spacing, component mappings, assets, copy, interactive states, transitions, responsive variants, and complexity/error-likelihood scores - Split catalogue into index + shared-styles + per-section files so each subagent loads only what it needs - QA subagent prompts adapt analysis depth based on complexity score (score 3 triggers quadrant decomposition, per-element chart checks, etc.) - Trimmed Key Rules table to a compact Hard Rules list; collapsed verbose gate explanation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… use combined distance
…rence for SSIM integration
…ours; fix normalised distance threshold
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build_treeto accept both image arrays simultaneously and compute an SSIM score per node alongside the existing colour averagenormalise_and_scoreto combine colour distance and SSIM into a singledistance = max(norm_colour_dist, norm_ssim_diff)— either signal can surface a divergent region independentlydiff_trees, the leaf selection snippet, Step 5 report fields, Quick Reference, and Common Mistakes to reflect the new dual-signal pipelineTest Plan
/tmp/test_ssim.py— verifiesnode_ssimlogic and scikit-image import (python3.13 /tmp/test_ssim.py)/tmp/test_build_tree.py— verifies dual-arraybuild_treeand stop condition (python3.13 /tmp/test_build_tree.py)/tmp/test_normalise.py— verifiesnormalise_and_scoreedge cases including None SSIM and zero-division (python3.13 /tmp/test_normalise.py)/tmp/test_e2e.py— end-to-end: synthetic image pair with a red rectangle; top divergent leaf should overlap the rectangle withdistance > 0.5andcolour_distance_raw > 0(python3.13 /tmp/test_e2e.py)scikit-imageis installed:pip3.13 install scikit-image